#include <stdio.h>
#include "swap_numbers.h"

#define swap1(type, i, j) {type t = i; i = j; j = t;}

void swap2(int* a, int *b) {
    int tmp = *a;
    *a = *b;
    *b = tmp;
}

void swap3(int &a, int &b) {
    int tmp = a;
    a = b;
    b = tmp;
}

void test_swap_numbers() {
	int num1 = 5;
	int num2 = 4;
	printf("Before Swapping: num1 = %d, num2 = %d\n", num1, num2);
	swap1(int, num1, num2);
	printf("After Swapping (Method 1): num1 = %d, num2 = %d\n", num1, num2);
	swap2(&num1, &num2);
	printf("After Swapping (Method 2): num1 = %d, num2 = %d\n", num1, num2);
	swap3(num1, num2);
	printf("After Swapping (Method 3): num1 = %d, num2 = %d\n", num1, num2);
}
